<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/jsp/component/common.jsp" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" ></meta>
    <title>KB值新增</title>
    <link rel="stylesheet" href="${frames}/css/lib/bootstrap.min.css" type="text/css" type="text/css">
    <link rel="stylesheet" href="${newframe}/css/base/base.css" type="text/css">
    <link rel="stylesheet" href="${newframe}/css/common.css" type="text/css">
   	<%@ include file="/WEB-INF/jsp/component/commonBottom.jsp" %>
   	<script src="${assets}/bootstrapValidator/js/bootstrapValidator.js"></script>
   	<script src="${assets}/bootstrapValidator/js/language/zh_CN.js"></script>
   	<script>
   	$(document).ready(function() {
   		$('#myForm').bootstrapValidator({
            message: 'This value is not valid',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                kValue: {
                    validators: {
                        notEmpty: true
                    }
                },
                bValue: {
                    validators: {
                        notEmpty: true
                    }
                }
            }
        }).on('success.form.bv', function (e) {
            e.preventDefault();
            $.ajax({
                url:'${URL_QULITITY_ADDKB}',
                type:'post',
                data:$('#myForm').serialize(),
                async : false, //默认为true 异步
                error:function(){
                    alert('error');
                },
                success:function(data){
                	closeFrame();
                }
            });
        });
   	});
	function closeFrame(){
		window.parent.table.ajax.reload(null);
		window.parent.simpleCloseModal();
	}
   	</script>
</head>
<body style="width: 98%">
<form id="myForm" class="form-horizontal" method="post" >
    <input type="hidden" id="machineId" name="machineId" value="${machineId}" />
    <div class="clearfix">
	    <div class="form-group col-sm-6">
	        <label class="col-sm-4 control-label">项目批号:</label>
	        <div class="col-sm-8">
	            <input type="text" id="projectBatch" name="projectBatch" class="form-control"  placeholder="请输入项目批号">
	        </div>
	    </div>
	    <div class="form-group col-sm-6">
	        <label class="col-sm-4 control-label">通道:</label>
	        <div class="col-sm-8">
	            <input type="text" id="ch" name="ch" class="form-control" placeholder="请输入通道">
	        </div>
	    </div>
	    <div class="form-group col-sm-6">
	        <label class="col-sm-4 control-label">K值:</label>
	        <div class="col-sm-8">
	            <input type="text" id="kValue" name="kValue" class="form-control"  placeholder="请输入K值">
	        </div>
	    </div>
	    <div class="form-group col-sm-6">
	        <label class="col-sm-4 control-label">B值:</label>
	        <div class="col-sm-8">
	            <input type="text" id="bValue" name="bValue" class="form-control" placeholder="请输入B值">
	        </div>
	    </div>
	    <div class="form-group col-sm-6">
	        <label class="col-sm-4 control-label">项目名称:</label>
	        <div class="col-sm-8">
	            <input type="text" id="projectName" name="projectName" class="form-control" placeholder="请输入项目名称">
	        </div>
	    </div>
	</div>
    <div class="modal-footer" style="text-align: center ">
        <button type="button" class="btn btn-default" data-dismiss="modal" id="closeModalButt" onclick="closeFrame()">关闭</button>
        <button type="submit" class="btn btn-primary">保存</button>
    </div>
</form>
</body>
</html>